Skip to content

fix(server): CLIProxyAPI updates work behind TLS-inspecting proxies - #121

Merged
ScriptedAlchemy merged 1 commit into
mainfrom
fix/server-trust-system-ca
Nov 15, 2026
Merged

ScriptedAlchemy merged 1 commit into
mainfrom
fix/server-trust-system-ca

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Problem

On K3XJYYYX7H, updating the inference host failed with InferenceProxyError: Could not install the verified CLIProxyAPI update. That network's gateway (SealSuite SWG) re-signs release-assets.githubusercontent.com, which api.github.com redirects asset downloads to. curl and browsers trust the gateway's root through the macOS keychain. Node trusts only its bundled roots, so the download failed during the TLS handshake:

HttpClientError: Transport error (GET https://api.github.com/repos/router-for-me/CLIProxyAPI/releases/assets/751352768)
  [cause]: TypeError: fetch failed
    [cause]: Error: unable to get local issuer certificate

safeFailure replaced that cause with the generic message.

Fix

At startup, runCli now calls trustSystemCertificates(). It adds the OS-store roots to Node's default CA list without removing any existing root. Because it changes process-wide trust, every outbound HTTPS call behind such proxies now works, not only this download. Safeguards:

  • It does nothing when the default list can't be enumerated (--use-openssl-ca), so those roots aren't lost.
  • It does nothing when the OS store can't be read.
  • Startup NODE_EXTRA_CA_CERTS roots stay in the default list. The desktop shell's later CA refresh in DesktopTelemetryReceiver keeps the system roots, because it captures them as part of its base list.

The cost is about 60ms once, on the full server path. That is the same cost --use-system-ca pays on its first TLS connection. The per-call fast paths in binMain.ts, such as acp-mcp-call, don't run it.

Verification

  • Unit tests in outboundHttp.test.ts cover merge and dedupe, non-enumerable trust, and an unreadable OS store. vp run check:changed passes.
  • On K3XJYYYX7H (Node 26.13.1), fetching the 8.0.73 darwin-arm64 asset:
    before FAILED unable to get local issuer certificate
    system roots added: 3
    after status 200 bytes 23867802
    

Done by Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Node trusts only its bundled roots, so on networks whose gateway re-signs
GitHub's asset host the update download failed with "unable to get local
issuer certificate", surfaced as "Could not install the verified
CLIProxyAPI update." The server now adds OS-store roots at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 14ff582

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ScriptedAlchemy
ScriptedAlchemy merged commit a6a514d into main Nov 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant